﻿<?php
require("conexao.php");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>produto</title>
<style type="text/css">
<!--
.style1 {
	font-size: 18px;
	font-weight: bold;
}
.style2 {font-size: 12px}
-->
</style>
</head>

<body>
<div class="tbglobal">
<div id="titulo">Lista de Contas a Pagar e Receber</div>
<div id="tabela">
<table border="0" align="center" cellpadding="0" cellspacing="0">
      <tr class="yellow">
        <td><div align="center"><strong>Número da Conta</strong></div></td>
        <td><div align="center"><strong>Classificação</strong></div></td>
        <td width="6%"><div align="center"><strong>Data de vencimento</strong></div></td>
        <td width="7%"><div align="center"><strong>Data de Pagamento</strong></div></td>
        <td width="5%"><div align="center"><strong>Valor</strong></div></td>
        <td width="6%"><div align="center"><strong>Tipo</strong></div></td>
        <td width="13%"><div align="center"><strong>Descrição</strong></div></td>
        <td width="6%"><div align="center"><strong>Situação</strong></div>          <div align="center"></div></td>
        <td width="7%"><div align="center"><strong>Comprovante</strong></div></td>
        <td colspan="2"><div align="center"><strong>Ação</strong></div></td>
      </tr>
      <?php 
	  $sql = "select c.*, o.*, t.* from contaspagarreceber c, comprovantes o, conta t where c.idconta = t.idconta and c.idcontas = o.idcontas order by c.data_vcto";
	  $resultado = mysql_query($sql);
		while ($coluna = mysql_fetch_array($resultado)) { ?>
      <tr>
        <td width="14%"><div align="left" class="style2">
          <div align="center"><?php echo $coluna["numero_conta"]?></div>
        </div></td>
        <td width="13%"><div align="center"><?php echo $coluna["idclassificacao"]?></div></td>
        <td><div align="left" class="style2">
          <div align="center"><?php echo $coluna["data_vcto"] ?></div>
        </div></td>
        <td><div align="center"><?php echo $coluna["data_pgto"] ?></div></td>
        <td><div align="center">R$ <?php echo $coluna["valor"] ?></div></td>
        <td><div align="center"><?php echo $coluna["tipo"] ?></div></td>
        <td><div align="left" class="style2">
          <div align="center"><?php echo $coluna["descricao"] ?></div>
        </div></td>
        <td><div align="left" class="style2">
          <div align="center"><?php echo $coluna["situacao"] ?></div>
        </div>          <div align="center"></div></td>
        <td><div align="center"><?php echo '<br /><a href="' . 'uploads/' . $coluna["comprovante"] . '">'.$coluna["comprovante"].'</a>'; ?></div></td>
        <td width="10%">
        <div align="center"><a href="principal.php?link=11&amp;acao=Alterar&amp;id=<?php echo $coluna["idcontas"]; ?>"><img src="imagens/lapis.gif" width="20" height="20" border = "0" /></a></div></td>
        <td width="13%">
        <div align="center"><a href="principal.php?link=11&amp;acao=Excluir&amp;id=<?php echo $coluna["idcontas"]; ?>"><img src="imagens/x.gif" width="20" height="20" border="0" /></a></div></td>
      </tr>
      <?php } ?>
      <tr>
        <td colspan="11"><div align="right"><a href="principal.php?link=11"><img src="imagens/inserir.gif"width="44" height="39" border="0" /></a></div></td>
      </tr>
</table>
   
  </div>
   </div>
</body>
</html>
